package cn.store.dao;

import cn.store.domain.Product;

import java.sql.SQLException;
import java.util.List;
import java.util.Map;

public interface ProductDao {

	List<Product> findHots()throws Exception;

	List<Product> findNews()throws Exception;

	Product findProductByPid(String pid)throws Exception;

	int findTotalRecords(String cid)throws Exception;

	List findProductsByCidWithPage(String cid, int startIndex, int pageSize)throws Exception;

	int findTotalRecords(Map<String,Object> searchWords)throws Exception;

	List<Product> findAllProductsWithPage(int startIndex, int pageSize, Map<String,Object> searchWords)throws Exception;

	void saveProduct(Product product)throws Exception;

	void updateProduct(Product product) throws SQLException;

    int deleteProduct(String pid) throws SQLException;
}
